package com.xszx.service.impl;


import com.xszx.entity.*;
import com.xszx.mapper.UserMapper;
import com.xszx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (User)表服务实现类
 *
 * @author makejava
 * @since 2024-10-31 09:52:04
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
private UserMapper userMapper;
    @Override
    public Integer forBusiness(User user) {
        Integer i= userMapper.forBusiness(user);
        return i;
    }

    @Override
    public Integer getisSalesOver500(User user) {
      Integer i=  userMapper.getisSalesOver500(user);
        return i;
    }

    @Override
    public void addGood(Goods goods) {
     userMapper.addGood(goods);

    }

    @Override
    public List<Comments> getGoodsComments(Goods goods) {
        List<Comments> list=userMapper.getGoodsComments(goods);
        return list;
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public Orders checkOrder(Goods goods) {
        Orders orders=userMapper.checkOrder(goods);
        return orders;
    }

    @Override
    public Shopping checkShopping(Goods goods) {
        Shopping shopping=userMapper.checkShopping(goods);
        return shopping;
    }

    @Override
    public Goods getGoods(Goods goods) {
        Goods goods1=userMapper.getGoods(goods);
        return goods1;
    }

    @Override
    public void delGoods(Goods goods) {
        userMapper.delGoods(goods);
    }

    @Override
    public void addGoods(Goods goods) {
        userMapper.addGoods(goods);
    }

    @Override
    public void updateGoods(Goods goods) {
        userMapper.updateGoods(goods);
    }

    @Override
    public List<Goods> getSameAddress(User user) {
        List<Goods> goods=userMapper.getSameAddress(user);
        return goods;
    }

    @Override
    public void userPay(Orders orders) {
        userMapper.userPay(orders);
    }

    @Override
    public List<UserAddress> getUserAddress(User user) {
        List<UserAddress> userAddressList=userMapper.getUserAddress(user);
        return userAddressList;
    }

    @Override
    public void addUserAddress(UserAddress userAddress) {
        userMapper.addUserAddress(userAddress);
    }

    @Override
    public void delUserAddress(UserAddress userAddress) {
        userMapper.delUserAddress(userAddress);
    }

    @Override
    public void updateUserAddress(UserAddress userAddress) {
        userMapper.updateUserAddress(userAddress);
    }

    @Override
    public double[] LineChart() {
        double[] Array=userMapper.LineChart();
        return Array;
    }

    @Override
    public List<Goods> posted(User user) {
        List<Goods> goodsList=userMapper.posted(user);
        return goodsList;
    }


    @Override
    public List<Orders> sold(User user) {
        List<Orders> ordersList=userMapper.sold(user);
        return ordersList;
    }

    @Override
    public void changePwd(String pwd,int uid) {
        userMapper.changePwd(pwd,uid);
    }

    @Override
    public List<Orders> bought(User user) {
        List<Orders> ordersList=userMapper.bought(user);
        return ordersList;
    }

    @Override
    public List<Comments> checkReviews(User user) {
        List<Comments> commentsList=userMapper.checkReviews(user);
        return commentsList;
    }

    @Override
    public void delShopping(Shopping shopping) {
        userMapper.delShopping(shopping);
    }

    @Override
    public List<Goods> getSYGoodsList() {
        List<Goods> goodsList=userMapper.getSYGoodsList();
        return goodsList;
    }

    @Override
    public List<Goods> getSYMHGoodsList(int gtid) {
        List<Goods> goodsList=userMapper.getSYMHGoodsList(gtid);
        return goodsList;
    }

    @Override
    public UserAddress upUserAddress(UserAddress userAddress) {
       UserAddress userAddress1= userMapper.upUserAddress(userAddress);
        return userAddress1;
    }


}

